//1.对象，面相对象..
//OO, Orientated Object
//1.封装，继承，多态
var obj=1;
console.log(obj);
obj="hello world!";
console.log(obj);

//2.定义对象            ()函数 []数组 {}对象
obj={};
//属性(key)：值（value）不同属性之间用逗号分隔
var student={
    stuno:'2206040114',
    stuname:'李三光',
    sex:'male',
    tel:'02180521235',
    classname:'计算机2221',
    //study:function(){
        //console.log(this.stuname+"正在学习中！");
    //},
    //eating:()=>console.log(this.stuname+"正在吃饭中！"),
    //sleeping:()=>console.log(this.stuname+"在休息！"),
}
//访问对象成员,使用.来访问对象的属性
//console.log(student.stuname);
//student.study();
//student.eating();
//ytystudent.sleeping();
//2.动态访问，obj[key]，可以使用for in 来遍历对象
for(let k in student){
    console.log(student[k]);
}